package com.aabte.permissionframeworklearn.permission.param;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author Daniel
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AclModuleParam {

    private Long id;

    @NotBlank(message = "权限模块名称不能为空！")
    @Length(min = 2, max = 64, message = "权限模块名称长度在2-64个字符")
    private String name;

    private Long parentId = 0L;

    @NotNull(message = "权限模块展示顺序不能为空！")
    private Integer seq;

    @Length(max = 200, message = "权限模块备注字符在200个以内！")
    private String remark = "";

    @NotNull(message = "权限模块状态不能为空!")
    @Min(value = 0, message = "权限模块状态不合法！")
    @Max(value = 1, message = "权限模块状态不合法！")
    private Integer status;

}
